﻿/*----------------------------------------------------------------
// Copyright (C) 2016 通通优品版权所有。
// 命名空间: STOWaybillMall.Dapper
// 类名：STOWaybillMallDbContext
// 功能描述：N/A
// 
// 创建标识：Roc.Lee(李鹏鹏) 2017/8/9 15:51:05 TEC-ROCLEE Roc.Lee

// 修改标识：
// 修改描述：
// 
//
//----------------------------------------------------------------*/
using Abp.EntityFramework;
using STOWaybillMall.Core;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.SqlServer;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EntityFramework.DynamicFilters;
using System.Data.Common;
using System.Data.Entity.Core.Objects;
using System.Data.Entity.Infrastructure;

namespace STOWaybillMall.Dapper
{
   // [DbConfigurationType(typeof(DapperDbContextConfiguration))]
    public class STOWaybillMallDbContext : AbpDbContext
    {
        /// <summary>
        /// Default constructor.
        /// Do not directly instantiate this class. Instead, use dependency injection!
        /// </summary>
        public STOWaybillMallDbContext()
        {

        }

        /// <summary>
        /// Constructor with connection string parameter.
        /// </summary>
        /// <param name="nameOrConnectionString">Connection string or a name in connection strings in configuration file</param>
        public STOWaybillMallDbContext(string nameOrConnectionString)
            : base(nameOrConnectionString)
        {

        }

        public STOWaybillMallDbContext(DbCompiledModel model)
            : base(model)
        {

        }

        /// <summary>
        /// This constructor can be used for unit tests.
        /// </summary>
        public STOWaybillMallDbContext(DbConnection existingConnection, bool contextOwnsConnection)
            : base(existingConnection, contextOwnsConnection)
        {

        }

        public STOWaybillMallDbContext(string nameOrConnectionString, DbCompiledModel model)
            : base(nameOrConnectionString, model)
        {

        }

        public STOWaybillMallDbContext(ObjectContext objectContext, bool dbContextOwnsObjectContext)
            : base(objectContext, dbContextOwnsObjectContext)
        {
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        public STOWaybillMallDbContext(DbConnection existingConnection, DbCompiledModel model, bool contextOwnsConnection)
            : base(existingConnection, model, contextOwnsConnection)
        {
        }
        //public virtual DbSet<BatchExpressWaybillInfo> BatchExpressWaybillInfo { get; set; }
        //public virtual DbSet<BatchExpressWaybillUseInfo> BatchExpressWaybillUseInfo { get; set; }
        //public virtual DbSet<GeneralExpressWaybillInfo> GeneralExpressWaybillInfo { get; set; }
        //public virtual DbSet<ImageInfo> ImageInfo { get; set; }
        //public virtual DbSet<MallConfigInfo> MallConfigInfo { get; set; }
        //public virtual DbSet<MangeOperationRecord> MangeOperationRecord { get; set; }
        //public virtual DbSet<OfflinePaymentOrderInfo> OfflinePaymentOrderInfo { get; set; }
        //public virtual DbSet<OnlinePaymentMange> OnlinePaymentMange { get; set; }
        //public virtual DbSet<OnlinePaymentOrderInfo> OnlinePaymentOrderInfo { get; set; }
        //public virtual DbSet<OrderBaseInfo> OrderBaseInfo { get; set; }
        //public virtual DbSet<OrderExpressInfo> OrderExpressInfo { get; set; }
        //public virtual DbSet<OrderGeneralReceiptInfo> OrderGeneralReceiptInfo { get; set; }
        //public virtual DbSet<OrderOperationRecord> OrderOperationRecord { get; set; }
        //public virtual DbSet<OrderPaymentInfo> OrderPaymentInfo { get; set; }
        //public virtual DbSet<OrderProductInfo> OrderProductInfo { get; set; }
        //public virtual DbSet<OrderReceiptBaseInfo> OrderReceiptBaseInfo { get; set; }
        //public virtual DbSet<ProductBaseInfoImages> ProductBaseInfoImages { get; set; }
        //public virtual DbSet<ProductDetailTemplate> ProductDetailTemplate { get; set; }
        //public virtual DbSet<ProductDetailTemplateInfo> ProductDetailTemplateInfo { get; set; }
        //public virtual DbSet<ProductInfo> ProductInfo { get; set; }
        //public virtual DbSet<ProductSpecInfo> ProductSpecInfo { get; set; }
        //public virtual DbSet<ProductSpecProp> ProductSpecProp { get; set; }
        //public virtual DbSet<UserBaseInfo> UserBaseInfo { get; set; }
        //public virtual DbSet<UserBuyProductConfig> UserBuyProductConfig { get; set; }
        //public virtual DbSet<UserOperationRecord> UserOperationRecord { get; set; }
        //public virtual DbSet<UserReceiptInfo> UserReceiptInfo { get; set; }
        //public virtual DbSet<UserStoreInfo> UserStoreInfo { get; set; }
        //public virtual DbSet<OrderAuditInfo> OrderAuditInfo { get; set; }
        //public virtual DbSet<OrderCloseInfo> OrderCloseInfo { get; set; }
        //public virtual DbSet<OrderSplitInfo> OrderSplitInfo { get; set; }
        //public virtual DbSet<ProductBaseInfo> ProductBaseInfo { get; set; }

        //protected override void OnModelCreating(DbModelBuilder modelBuilder)
        //{
        //    //modelBuilder.DisableFilterGlobally("SoftDelete");
        //    //modelBuilder.DisableFilterGlobally("MustHaveTenant");
        //    //modelBuilder.DisableFilterGlobally("MayHaveTenant");
        //    //modelBuilder.DisableFilterGlobally("SoftDelete");
        //    base.OnModelCreating(modelBuilder);
        //}
    }
    //public class DapperDbContextConfiguration : DbConfiguration
    //{
    //    public DapperDbContextConfiguration()
    //    {
    //        SetProviderServices(
    //            "System.Data.SqlClient",
    //            SqlProviderServices.Instance
    //        );
    //    }
    //}
}
